package com.restaurant.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.restaurant.entity.Menu;
import com.restaurant.service.DeptService;
import com.restaurant.service.MenuService;

@Controller
public class restaurantController {
	@Autowired
	private DeptService deptService;

	public DeptService getDeptService() {
		return deptService;
	}
	public void setDeptService(DeptService deptService) {
		this.deptService = deptService;
	}
	
	@Autowired
	private MenuService menuService;

	public MenuService getMenuService() {
		return menuService;
	}

	public void setMenuService(MenuService menuService) {
		this.menuService = menuService;
	}
	/**
	 * 注册页面
	 */
	@RequestMapping(value="/auth1")
	public  ModelAndView register(){
		ModelAndView mv =new ModelAndView();
		mv.setViewName("auth/index1");
		return mv;
	}

	/*
	 * 菜单库查询所有菜单
	 * */
	@RequestMapping(value="/ku")
	public ModelAndView storage(){
		ModelAndView mv = new ModelAndView();
		mv.setViewName("ku");
		List<Menu> menus = menuService.selectAll();
		mv.addObject("menus",menus);
		return mv;
		
	}
	
}	
